package com.xuelang.pipeline.domain.resource.repository;

import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.resource.dto.CloudEnvironmentQuery;
import com.xuelang.pipeline.domain.resource.CloudEnvironment;

import java.util.List;

/**
 * 多云环境仓库
 *
 * @author liuyuan.ly
 * @since 2024/5/14 9:48
 */
public interface CloudEnvironmentRepository {
    /**
     * 获取多云环境列表，有过滤条件
     *
     * @param currentPage
     * @param pageSize
     * @param cloudEnvironmentQuery
     * @return
     */
    PageRecord<CloudEnvironment> pageList(long currentPage, long pageSize, CloudEnvironmentQuery cloudEnvironmentQuery);
    /**
     * 获取多云环境列表，有过滤条件
     *
     * @param cloudEnvironmentQuery
     * @return
     */
    List<CloudEnvironment> list(CloudEnvironmentQuery cloudEnvironmentQuery);

    /**
     * 新增多云环境
     *
     * @param cloudEnvironment
     * @return
     */
    Boolean save(CloudEnvironment cloudEnvironment);

    /**
     * 更新多云环境
     *
     * @param cloudEnvironment
     * @return
     */
    Boolean update(CloudEnvironment cloudEnvironment);
    /**
     * 删除多云环境
     *
     * @param id
     * @return
     */
    Boolean delete(Long id);

    /**
     * 是否存在该名称的多云环境
     *
     * @param id
     * @param name
     * @return
     */
    Boolean existsName(Long id, String name);

    /**
     * 是否存在该别名的多云环境
     *
     * @param id
     * @param alias
     * @return
     */
    Boolean existsAlias(Long id, String alias);
    /**
     * 查询多云环境
     *
     * @param id
     * @return
     */
    CloudEnvironment query(Long id);
}
